import 'dart:async';

import 'package:flutter/material.dart';
import '../../utils/application.dart';

class LaunchScreen extends StatefulWidget {
  const LaunchScreen({super.key});

  @override
  State<LaunchScreen> createState() => _LaunchScreenState();
}

class _LaunchScreenState extends State<LaunchScreen> {
  @override
  void initState() {
    Timer(const Duration(seconds: 2), () {
      Application.router!.navigateTo(context, '/tabbar', clearStack: true);
    });
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        width: double.infinity,
        height: MediaQuery.of(context).size.height,
        decoration: const BoxDecoration(
          image: DecorationImage(
            image: AssetImage('lib/assets/images/launch.gif'),
            fit: BoxFit.fill,
          ),
        ),
      ),
    );
  }
}
